This invention concerns an information processing system in which an object-oriented program is built into a computer. More specifically, it concerns a technique for writing data into and reading data out of an internal memory.
Java (a registered trademark, of Sun Microsystems), the object-oriented programming language developed by Sun Microsystems, does not use a pointer to access memory, which prevents data from being improperly written over in the memory. This language can be effectively used to construct an extremely safe system. However, with Java it is not possible to freely access any desired address in the memory as it is with other prior art programming languages using pointers. It is therefore necessary to use one of the following schemes to create a system which would allow a program such as an operating system (hereinafter, xe2x80x9cOSxe2x80x9d) to access the memory.
One way to do this is to build a separate program in the computer, using a language like C, which can access any desired address in the memory. In the program of Java, a method is set up for the memory access. By accessing the method, It will be able to access the memory.
As an alternative, a scheme has also been proposed by which Java can access the memory independently. This involves developing a special compiler to convert a given command to the assembler code needed to access the memory.
The first scheme, which uses an indirect method to access the memory, requires time to start the program to access the method. Accessing the memory is inefficient, and it is difficult to operate the system at high speed. It cannot be used in devices which have rigorous real-time requirements.
The system which uses the second method, involving a separate compiler, would be difficult to implement in a device which has only a standard-specification compiler. It is not a system with universal application.
On the other hand, a programming language which accesses the memory using a pointer has no way to restrict which programs can access the memory, so it has no way to prevent improperly overwriting data in the memory.
The present invention is developed in consideration of the problems described above. Its objective is to provide an information processing system capable of instantaneous memory access which can be suitable for use in any programming environment.
The second objective of this invention is to provide a highly reliable information processing system in which the programs with access to the memory can be restricted in order to prevent accidental overwrites.
The third objective of this invention is to provide a convenient information processing system which can maintain its reliability by using a program to vary the accessibility of different areas of the memory.
As can be seen in FIG. 3, when one or more array objects are declared in an environment created by an object-oriented language such as Java, a number of data storage areas is established in the memory which is equal to the number of object array elements declared. Thereafter, whenever it receives a command to write or read data involving a given element of one of the array objects, the program looks up the address which corresponds to the order of the indicated element in the array (which is indicated in the program as the value of a index appended to the object name) in the area where the aforesaid data are stored. (Hereafter, this sort of reading and writing of data using array elements is called xe2x80x9celement referencexe2x80x9d.)
If, for example, we are to declare an array object of a size corresponding to the total size of addresses in the memory, the entire memory will be considered to be the data storage area. Then by looking up the given element, we can access whatever address in the memory we desire.
This invention makes use of the principle described above. The information processing system disclosed in claim 1 of this application has an object reference table to distinguish the areas where different sets of object data that are established by an object-oriented program are stored; and a program executing means to execute the aforesaid program while distinguishing, by means of the aforesaid object reference table, the correct data storage area for an object indicated by the aforesaid program.
In the aforesaid object reference table according to this invention, is stored a number of virtual array objects (also referenced as memory objects) proportional to the number of addresses in the memory of the computer housing this information processing system. When the program executing means receives a message to indicate that a given element in a virtual array object should be looked up, it determines, based on what is listed in the aforesaid object reference table, that the entire memory is a data storage area of the aforesaid virtual array object, and it looks up the aforesaid given element.
To construct the aforesaid object-oriented program, one can use a programming language like Java which does not employ a pointer to access the memory, or a language like C++ which does use a pointer, provided that pointer access is prohibited. The program executing means to execute the program can be realized by a device to execute the byte code or machine language obtained by compiling these programs (a compiler or interpreter); or by a means to identify the area where the data representing the object indicated by the program is stored by looking it up in an object reference table (in concrete terms, this will have a program to control the order of discrimination processing).
In addition to the configuration disclosed in claim 1, the information processing system related to the invention disclosed in claim 4 of this application has a built-in access restricting means to restrict access to the computer""s memory depending on what sort of program is to be executed. When a program is to be executed whose access is permitted by the access restricting means to restrict access, the access restricting means receives a message or command indicating that it should look up a given element in the aforesaid virtual array object. It finds in the object reference table that the data storage area for the virtual array object consists of the entire memory, and it executes its reference processing with respect to the aforesaid indicated element.
The aforesaid access restricting means might, for example, permit a program consisting of the OS to access the memory but deny access to a program consisting of an ordinary application. It would, in other words, restrict access to the memory according to what the program""s function is or what type of program it is. In addition, access to the memory can be restricted by using as a criterion the developer of the program, the version of the program or the date of its creation, the name of the program, or a password.
According to the invention disclosed in claim 5 of this application, the aforesaid access restricting means to restrict memory access has built into it a table which it uses to determine which programs are permitted to access the aforesaid memory.
This table can, for example, be a table which stores names of programs or numbers used to discriminate classes of programs which should be permitted to access the memory; or it can be a table in which the names of all classes of programs are stored; classes which are permitted access are flagged.
With the invention disclosed in claim 6 of this application, a virtual array object of a size proportional to the number of addresses stored in an area of permitted access established in a given location in the computer""s memory is stored in an object reference table so as to correspond to the area of permitted access. When the program executing means receives a program telling it to look up a given element in the aforesaid virtual array object, the program executing means determines, based on the aforesaid object reference table, that the aforesaid area of permitted access is the area where data representing the aforesaid virtual array object are stored, and it looks up the indicated element.
Like the invention disclosed in claim 4, the information processing system provided by the invention disclosed in claim 7 of this application has an object reference table, a program executing means to execute a program and a access restricting means to restrict access to the memory. The access restricting means in claim 5 controls access to multiple memory objects based upon program or method category. (In some cases, the program will not be allowed to access any areas at all.)
For each area of permitted access, a virtual array object of a size proportional to the number of addresses in that area is stored in an object reference table. When it is to execute a program which is permitted access to a given area by the aforesaid access restricting means, the program executing means receives a message telling it to look up a given element in the array object corresponding to the area of permitted access. It determines, based on the aforesaid object reference table, that the aforesaid area of permitted access is the area where data representing the aforesaid virtual array object are stored, and it looks up the indicated element.
The invention disclosed in claim 2 of this application comprises one of the configurations described in claims 1, 4, 6 or 7. When the aforesaid computer is started, the object reference table with the aforesaid virtual array objects stored in it is initialized.
With the invention disclosed in claim 3 of this application, a number of virtual array objects of different types are stored in the aforesaid object reference table.
With the invention in claim 1, a virtual array object of a size commensurate with the number of addresses in the memory is created. Each element of this array object corresponds to an address in the memory. The desired address in the memory can be accessed by executing a program to look up a given element of the object. The area where the data representing this array object is stored is established virtually, so ordinary objects designated by the program will not be affected by these special array objects. A private data storage area can thus be secured in the memory, and accessing this area will not pose any particular problems.
The virtual array object is stored in an ordinary object reference table so that it can be distinguished from data storage areas for ordinary objects designated by the program. Thus the program to look up the aforesaid elements can be described using the same grammar as the program to look up elements of ordinary array objects. This makes it possible to look up elements in a generalized environment of program execution.
With the invention in claim 4, when a command or message is received to look up an element of the aforesaid virtual array object, the address in the memory which corresponds to the indicated element will be accessed only when the program being executed is one which is permitted access to the memory.
With the invention in claim 5, a table can be set up to allow programs which the developers trust to access the memory. Thus only programs stored in the table will be able to look up elements of the virtual array object.
With the invention in claim 6, programs are permitted access only to an area of a given size in the memory which is designated as accessible, and they are forbidden access to addresses outside this area. With the invention in claim 5, a number of areas are established to which access depends on the type of program being executed and its capabilities. This allows the areas which may be accessed to vary depending on the program being executed.
With the invention in claim 2, a virtual array object which is not defined in an actual program is created when the object reference table is set up as the computer is initialized.
With the invention in claim 3, a number of array objects of different shapes are created in the object reference table. By changing the object to be looked up, one can make it conform to the size of the data when it is accessed.